function Create(self)
	self.LagTimer = 5;
	self.Level = 0;
	self.HasFriend = 0;
	self.LostFriend = 0;
	self.find = null;
	self.DoesInfect = 0;
	self.InfectTimer = 2+math.random(5);
	self.Frame = math.floor(math.random()*3);
	self.HUDVisible = false;

	self.TestDelay = 10;
end

function Update(self)
	self.InfectTimer = self.InfectTimer - 1;
	self.TestDelay = self.TestDelay - 1;
	self.LostFriend = 1;


--find new host
		if self.HasFriend == 0 then
			for actor in MovableMan.Actors do	
				local avgx = actor.Pos.X - self.Pos.X;
				local avgy = actor.Pos.Y - self.Pos.Y;
				local dist = math.sqrt(avgx ^ 2 + avgy ^ 2);
					if dist <= 80 and actor.Team == self.Team then
						if actor.ClassName == "AHuman" then
						self.find = actor.UniqueID;
					
						self.HasFriend = 1;
	
						elseif actor.ClassName == "ACrab" then
						self.find = actor.UniqueID;
						self.HasFriend = 1;
						end
					end
			end	
		end

--check current host	
			for actor in MovableMan.Actors do
				if actor.UniqueID == self.find then	
				self.Pos = actor.Pos;
				self.Vel.Y = 0;
				self.Vel.X = 0;
				self.RotAngle = actor.RotAngle;
				self.LostFriend = 0;

					if actor.Health < 100 then
					actor.Health = actor.Health + 1;
					end
					if self.Level == 3 then
					--spawn turret shroom
					self.spore = CreateActor("TurretSpore", "FUNGUS.rte");
					self.spore.Team = self.Team;
					self.spore.Pos = self.Pos		
					self.spore.Vel.Y = .5;
					MovableMan:AddActor(self.spore);
					self.Level = 4;
				end
			end
	end

--find new hosts
	if self.DoesInfect == 1 then
		--errors?
		for actor in MovableMan.Actors do	
		local avgx = actor.Pos.X - self.Pos.X;
		local avgy = actor.Pos.Y - self.Pos.Y;
		local dist = math.sqrt(avgx ^ 2 + avgy ^ 2);
			if dist <= 100 and self.DoesInfect == 1 and actor.Team ~= self.Team then
				self.spore = CreateActor("Fungus","FUNGUS.rte")
				self.spore.Team = self.Team
				self.spore.Pos = actor.Pos	
				MovableMan:AddActor(self.spore)
				self.DoesInfect = 0;
				self.Level = self.Level + 1;

					if self.Level >= 5 then 
						if math.random() > 0.05 then

						self.spore = CreateActor("ManEaterSpore","FUNGUS.rte")
						self.spore.Team = self.Team
						self.spore.Pos = self.Pos	
						MovableMan:AddActor(self.spore)
						end
					end
					if math.random() > 0.05 then
						if self.Level >= 3 then 
						self.spore = CreateActor("CapSpore","FUNGUS.rte")
						self.spore.Team = self.Team
						self.spore.Pos = self.Pos	
						MovableMan:AddActor(self.spore)
						end
					end
				end
			end
		end
	--end (ends doesinfect, likely the problem)
		--timer resets Infection Cycle
			if self.DoesInfect == 0 then
				self.InfectTimer = self.InfectTimer - .1;
			end

		if self.InfectTimer <= 0 then
		self.DoesInfect = 1;
		self.InfectTimer = 100;

			--end lag check
			--if self.LagTimer <= 0 then
			--self.LagTimer = 5;
			--end
		end

--check if I should delete myself
			if self.LostFriend == 1 then
				if math.random() > 0.05 then
				self.spore = CreateActor("ManEaterSpore","FUNGUS.rte")
				self.spore.Team = self.Team
				self.spore.Pos = self.Pos	
				MovableMan:AddActor(self.spore)
				end
			self:GibThis();
			end
			if self.TestDelay <= 0 then
				if self.LostFriend == 1 then
				self:GibThis();
			end
		end

	end
